package cn;

import cn.webrx.pojo.User;
import cn.webrx.service.UserSercie;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Date;

public class Demo {
    public static void main(String[] args) {
        var ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        var d = ctx.getBean(Date.class);
        var d1 = ctx.getBean(Date.class);
        var d2 = ctx.getBean(Date.class);
        //var a = new Date();
        System.out.println(d);

        System.out.println(d1 == d2);





        var s1 = Singleton.instance();
        var s2 = Singleton.instance();
        System.out.println(s1==s2);

        var u = ctx.getBean(User.class);
        var us = ctx.getBean(UserSercie.class);
        System.out.println(u);
        System.out.println(us);



    }
}
